package ca.mcgill.model.digraph;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import ca.mcgill.model.functional.Transition;
import ca.mcgill.model.implementation.Task;

public class Digraph {

	/**
	 * The transitions represent the vertices of the digraph
	 */
	private Set<Transition> vertices = new HashSet<Transition>();

	private List<DigraphEdge> edges = new ArrayList<DigraphEdge>();

	/**
	 * Task behavior of which is specified with this digraph
	 */
	private Task task;

	public Digraph() {

	}

	public Digraph(Task task) {
		this.task = task;
	}

	public void addVertex(Transition vertex) {
		this.vertices.add(vertex);
	}

	public void addEdge(DigraphEdge edge) {
		this.edges.add(edge);
	}

	public Set<Transition> getVertices() {
		return this.vertices;
	}

	public List<DigraphEdge> getEdges() {
		return this.edges;
	}

	public void addVertices(List<Transition> vertices) {
		this.vertices.addAll(vertices);
	}

	public void addEdges(List<DigraphEdge> edges) {
		this.edges.addAll(edges);
	}

}
